<?php
namespace App\Services;
use App\Events\SendMessageEvent;
use Illuminate\Support\Facades\Log;
use App\Events\TestEvent;
use App\Models\Company;
use App\Models\TaskLog;
use App\Models\User;
use App\Models\Post;
use App\Models\Comment;


use Illuminate\Database\Eloquent\Collection;



class PostService{

    protected  $postModel;

    public function  __construct() {
        $this->postModel = new Post();
    }


    public function getPostList($userId) {
        $postList = $this->postModel->where('user_id', $userId)->get();
        return $postList;
    }

    // public function getPostCommentList() {
    //     $postCommentList = $this->postModel->getPostComments;
    //     dd($postCommentList);
    //     return $postCommentList;
    // }

    public function getPostCommentList() {
        $postCommentList = $this->postModel->with('comments')->get();
        return $postCommentList;
    }













}